package com.bw.controller;

import com.bw.domain.UserAddress;
import com.bw.service.UserAddresService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


//编写controlle层方法
@RestController
public class UserAddresController {
    @Autowired
    UserAddresService userInfoService;
//用户信息查询
    @RequestMapping("/list")
    public List t1(String addres,String name){
        List<UserAddress> list = userInfoService.getList(addres,name);
        return list;
    }
//添加用户信息
   @RequestMapping("add")
   public int t2(UserAddress userAddress){
        int i = userInfoService.add(userAddress);
        return i;
   }

//删除用户信息
    @RequestMapping("/del")
    public int t3(int id){
        int i = userInfoService.del(id);
        return i;
    }

}
